﻿using AMAP.Domain;
using AMAP.ServiceClasses.Common;
using AMAP.ServiceInterfaces;
using AMAP.ServiceInterfaces.Common;
using System.Linq;
using System.Web.Configuration;

namespace AMAP.ServiceClasses
{
    public class AmapService : BaseRepositoryService<Amap>, IAmapService
    {
        public AmapService(IDatabaseFactory databaseFactory)
            : base(databaseFactory)
        {
        }

        public Amap GetApplicationAMAP()
        {
            string name = WebConfigurationManager.AppSettings["AMAPName"].ToString();
            return this.dataContext.AmapSet.FirstOrDefault(a => a.Name == name);
        }
    }
}
